import { type SetupContext } from 'vue';

export default defineComponent({
	name: 'NumberRanger',
	setup(props, context: SetupContext) {
		const data = ref([]);
		console.log(props);

		watchEffect(() => {
			context.emit('update:modelValue', data.value);
		});
		return () => (
			<span style={{ width: '100%', display: 'flex' }}>
				<el-input-number
					ref="lt"
					class="input-number-lt"
					placeholder="大于等于"
					controls-position="right"
					modelValue={data.value[0]}
					style={{ width: 'unset' }}
				/>
				<span style={{ display: 'inline-flex', margin: '0 5px' }}>-</span>
				<el-input-number
					ref="gt"
					class="input-number-gt"
					placeholder="小于等于"
					controls-position="right"
					modelValue={data.value[1]}
					style={{ width: 'unset' }}
				/>
			</span>
		);
	},
});
